package com.baipiao.permission.backend.entity.response;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;

@Getter
@Schema(description = "响应状态枚举")
public enum ResStatusEnum {

    /**
     * 业务状态
     */
    insert(200, "插入成功"),
    update(200, "更新成功"),
    delete(200, "删除成功"),
    nothing_to_do(200, "无任何更改"),
    exist(200, "已存在"),
    fail(200, "失败"),

    /**
     * 系统状态
     */
    success(200, "成功"),
    login(200, "登录成功"),
    logout(200, "退出系统"),
    auth_fail(401, "未登录"),
    account_error(401, "账号或密码错误"),
    account_disable(401, "账号不可用"),
    account_locked(401, "账号被锁定"),
    password_expired(401, "密码过期"),
    no_permission(403, "没有权限"),
    error(999, "未知错误");

    @Schema(description = "状态码")
    private final Integer code;

    @Schema(description = "状态信息")
    private final String msg;

    ResStatusEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}
